import { createRouter, createWebHistory } from 'vue-router'
import Home_page from '../components/Home_page/Home_page.vue'
import Order_goods from '../components/Order_goods/Order_goods.vue'
import Personal_center from '../components/Personal_center/Personal_center.vue'
import Predetermine from '../components/Predetermine/Predetermine.vue'
import Login from '../components/Login/Login.vue'
import Admin from '../components/admin.vue'
import Home_libao from '../components/Home_page/Home_libao.vue'
import Home_my from '../components/Home_page/Home_my.vue'
import Home_qiaodao from '../components/Home_page/Home_qiaodao.vue'
import Home_shangcheng from '../components/Home_page/Home_shangcheng.vue'
import Home_youhuijuan from '../components/Home_page/Home_youhuijuan.vue'
import Home_type from '../components/Home_page/Home_type.vue'
import Evaluate from '../components/Order_goods/Evaluate.vue'
import Coupon from '../components/Personal_center/Coupon.vue'
import Member from '../components/Personal_center/Member.vue'
import Service from '../components/Personal_center/Service.vue'
import Person from '../components/Personal_center/Person.vue'
import mapplace from '../components/Predetermine/Mapplace.vue'

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [
        {
            path: '/',
            name: 'admin',
            component:Admin,
            children: [
                {
                    path:'/admin/Home_page',
                    name:'Home_page',
                    component:Home_page
                },
                {
                    path:'/admin/Order_goods',
                    name:'Order_goods',
                    component:Order_goods
                },
                {
                    path:'/admin/Personal_center',
                    name: 'Personal_center',
                    component: Personal_center
                },
                {
                    path:'/admin/Predetermine',
                    name:'Predetermine',
                    component: Predetermine
                },
                 // 地图
         {
            path: '/admin/mapplace',
            name: 'mapplace',
            component: mapplace
          },
      // 房间详情
      {
        path:'/admin/roomdetails',
        name:'roomdetails',
        component:()=>import('../components/Predetermine/Room_detail.vue')
      },
    //   购买订单房间
      {
        path:'/admin/buy_room_reservation',
        name:'buy_room_reservation',
        component:()=>import('../components/Predetermine/Buy_room_reservation.vue')
      },
                // 重定向到首页
                {
                    path:'/',
                    redirect:'/admin/Home_page'
                }
            ]
        },
        {
            path:'/evaluate',
            name:'Evaluate',
            component:Evaluate
        },
        {
            path:'/coupon',
            name:'Coupon',
            component:Coupon
        },
        {
            path:'/member',
            name:'Member',
            component:Member
        },
        {
            path:'/service',
            name:'Service',
            component:Service
        },
        {
            path:'/person',
            name:'Person',
            component:Person
        }
        ,
        {
            path: '/Login',
            name:'Login',
            component:Login
        },
        {
            path:'/Home_libao',
            name:'Home_libao',
            component:Home_libao
        },
        {
            path:'/Home_my',
            name:'Home_my',
            component:Home_my
        },
        {
            path:'/Home_qiaodao',
            name:'Home_qiaodao',
            component:Home_qiaodao
        },
        {
            path:'/Home_shangcheng',
            name:'Home_shangcheng',

            component:Home_shangcheng
        },
        {
            path:'/Home_youhuijuan',
            name:'Home_youhuijuan',
            component:Home_youhuijuan
        },
        {
            path:'/Home_type',
            name:'Home_type',
            component:Home_type
        }
    ]
})

export default router
